package com.luo.locationapp.activity;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.luo.locationapp.R;
import com.luo.locationapp.adapter.LocationMarkInfoAdapter;
import com.luo.locationapp.bean.Bean_App_location_user;
import com.luo.locationapp.global.GlobalContents;
import com.luo.locationapp.interfaces.impl.GeneralProcessorInterfaceImpl;
import com.luo.locationapp.link.LinkServiceTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

public class FootmarkActivity extends Activity {

	private TextView tv_title;
	private ListView lv_footmark;
	private ImageButton imgbt_markLo;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_footmark);
		initWidget();
		initData();
	}
	private void initWidget() {
		tv_title = (TextView) findViewById(R.id.footmark_tips);
		tv_title.setText(getIntent().getStringExtra("title"));
		
		lv_footmark = (ListView) findViewById(R.id.footmark_main_list);
		
		imgbt_markLo = (ImageButton) findViewById(R.id.footmark_imgbt_mark);
		
		List<Map<String, String>> data = new ArrayList<Map<String,String>>();
		lv_footmark.setAdapter(new LocationMarkInfoAdapter(FootmarkActivity.this, data));
		
		imgbt_markLo.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				startActivity(new Intent(FootmarkActivity.this, AddFootmarkActivity.class));
			}
		});
	}
	private void initData() {
		new LinkServiceTask(FootmarkActivity.this, new GeneralProcessorInterfaceImpl(lv_footmark)).execute("getMarkedLocationInfo", ((Bean_App_location_user) GlobalContents.userInfoMap.get("currentUser")).getId());
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}
	
	
}
